//package com.jcodecraeer.xrecyclerview;
//
//import android.content.Context;
//import android.support.v7.widget.LinearLayoutManager;
//import android.support.v7.widget.RecyclerView;
//
//import com.jcodecraeer.xrecyclerview.progressindicator.DivierItemDecoration;
//
////import com.example.administrator.nurse.model.RecyclerViewCommonAdapter;
//
///**
// *  Created by 林冠宏 on 2016/4/23.
// *  xRecyclerView 工具类
// *  默认采用 线性布局
// */
//
//public class recyclerViewHelper {
//
//    public RecyclerView.Adapter adapter; /** 适配器 */
//    private Context context;
//    private XRecyclerView recyclerView;
//
//    public recyclerViewHelper(Context context,XRecyclerView recyclerView){
//        this.context = context;
//        this.recyclerView = recyclerView;
//    }
//
//    public XRecyclerView getRecyclerView(){
//        return recyclerView;
//    }
//
//    private RecyclerView.LayoutManager layoutManager = null;
//    public recyclerViewHelper withLayoutManager(RecyclerView.LayoutManager layoutManager){
////        if (layoutManager==null){
////            this.layoutManager=new LinearLayoutManager(context);
////        }else{
//            this.layoutManager = layoutManager;
////        }
//        return this;
//    }
//
//    private boolean isPullRefrshOpen = false; /** 默认不开启下拉刷新 */
//    public recyclerViewHelper withPullRefrshOpen(boolean isPullRefrshOpen){
//        this.isPullRefrshOpen = isPullRefrshOpen;
//        return this;
//    }
//
//    public recyclerViewHelper withAdapter(RecyclerView.Adapter adapter){
//        this.adapter = adapter;
//        return this;
//    }
//
//    /** 接口分离，下拉刷新自己添加 */
//    public interface loadMoreListener{
//        void loadMore();
//    }
//
//    private loadMoreListener loadMoreListener;
//    public recyclerViewHelper withLoadMore(loadMoreListener loadMoreListener){
//        this.loadMoreListener = loadMoreListener;
//        return this;
//    }
//
//    public void initRecyclerView() {
//
//        recyclerView.setLayoutManager(layoutManager == null ? new LinearLayoutManager(context) : layoutManager);
//
//        /** 这两个不建议改 */
//        recyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
//        recyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//
//        recyclerView.setPullRefreshEnabled(isPullRefrshOpen); /** 不需要下拉刷新 */
//        recyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
//            @Override
//            public void onRefresh() {
//
//            }
//
//            @Override
//            public void onLoadMore() {
//                if(loadMoreListener!=null){
//                    loadMoreListener.loadMore();
//                }
////                RequestParams requestParams = new RequestParams();
////                requestParams.put("account", common.account);
////                requestParams.put("id", list.get(list.size() - 1).getId());
////                startLoadingDialog();
////                doPost(GetListInfoLoadMore, null, common.host + "TicketManage/getTickList.php", requestParams);
//            }
//        });
//        if(adapter!=null){
//            recyclerView.setAdapter(adapter);
//        }
//    }
//
//
//}
